<%@page pageEncoding="utf-8"%>
<form action="${pageContext.request.contextPath}/login.do?method=updatepsw" method="post" onsubmit="return(checkpsw());">
	<table align="center">
		<tr>
			<td><span>原始密码：</span></td><td><input type="password" name="oldpsw" id="oldpsw">
			<input type="hidden" name="oldpsw1" id="oldpsw1" value="${manager.password}">
			</td>
		</tr>
		<tr>
			<td><span>新密码    ：</span></td><td><input type="password" name="newpsw" id="newpsw"></td>
		</tr>
		<tr>
			<td><span>确认密码：</span></td><td><input type="password" name="repsw" id="repsw"></td>
		</tr>
		<tr>
			<td align="center"><input type="submit" name="submit" value="修改"></td><td align="center"><input type="reset" value="重置"></td>
		</tr>
	</table>
</form>

<script type="text/javascript">
function checkpsw(){
	var oldpsw = document.getElementById("oldpsw").value;
	var oldpsw1 = document.getElementById("oldpsw1").value;
	var newpsw = document.getElementById("newpsw").value;
	var repsw = document.getElementById("repsw").value;
	if(newpsw==""){
		alert("新密码不能为空！");
		return false;
	}
	if(oldpsw!=oldpsw1){
		alert("密码错误，请从新输入！");
		return false;
	}
	
	if(newpsw!=repsw){
	alert("新密码两次输入不一致！请从新输入。");
	return false;
	}
	return true;
}
</script>
